#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "LinkAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class OutputPin;
class Property;

/// <summary>
/// ReadLinkAction
/// A ReadLinkAction is a LinkAction that navigates across an Association to
/// retrieve the objects on one end.
/// </summary>
class UMLMODEL_EXPORT ReadLinkAction : public LinkAction {

public: // Constructors and destructors
    explicit ReadLinkAction(const QString& umlType="uml::ReadLinkAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// openEnds
    /// Returns the ends corresponding to endData with no value InputPin. (A well-formed
    /// ReadLinkAction is constrained to have only one of these.)
    /// </summary>
    virtual shared_ptr<vector<Property>> openEnds() const;

public: // Properties
    /// <summary>
    /// result getter
    /// The OutputPin on which the objects retrieved from the "open" end of those links
    /// whose values on other ends are given by the endData.
    /// </summary>
    shared_ptr<OutputPin> result() const;

    /// <summary>
    /// result setter
    /// The OutputPin on which the objects retrieved from the "open" end of those links
    /// whose values on other ends are given by the endData.
    /// </summary>
    void setResult(shared_ptr<OutputPin> value);

private: // Fields
    /// <summary>
    /// result
    /// The OutputPin on which the objects retrieved from the "open" end of those links
    /// whose values on other ends are given by the endData.
    /// </summary>
    shared_ptr<OutputPin> result_;

};

} // namespace uml
